# 定义基础镜像
FROM antball/jdk8:latest

# 定义维护者信息
LABEL maintainer="antball"

#定义构建时的参数
ARG MAVEN_VERSION=apache-maven-3.6.1

RUN yum install -y wget \
  && wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz \
  && tar xzvf apache-maven-3.6.1-bin.tar.gz -C /usr/local/  \
  && ln -sv /usr/local/apache-maven-3.6.1/ /usr/local/maven  \
  && rm -r apache-maven-3.6.1-bin.tar.gz

ENV MAVEN_HOME /usr/local/maven
ENV PATH $MAVEN_HOME/bin:${PATH}

  # && export MAVEN_HOME=/usr/local/maven  \
  # && export PATH=${MAVEN_HOME}/bin:${PATH}  \

CMD ["mvn", "-v"]
